<%@ include file="/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<head>
<script type="text/javascript" src="${ctx}/scripts/jquery-1.7.js"></script>
<script type="text/javascript" src="${ctx}/scripts/jquery-datepicker.js"></script>
<script type="text/javascript" src="${ctx}/scripts/jquery-ui-1.8.16.custom.min.js"></script>
<link href="${ctx}/css/pagination.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="${ctx}/css/jquery-ui-1.8.16.custom.css" />
<script>
		$(function() {
		$('#createTimeId').datepicker({ changeYear: true,changeMonth:true,yearRange: 'c-60:c+20'});
		});
</script>

<script>
	function check(){
		var branchName = document.getElementById("branchNameId");
		var branchSecretaryName = document.getElementById("branchSecretaryNameId");
		var createTime = document.getElementById("createTimeId").value;
		if(branchSecretaryName.value == "" || branchSecretaryName.value.replace(/(^\s*)/g, "") =="") {
			alert("书记不能为空！");
			branchSecretaryName.focus();
			return false;
		} 
		if(branchName.value.replace(/(^\s*)/g, "")=="" ) {
			alert("组织名称不能为空！");
			branchName.focus();
			return false;
		}
		if(createTime==null||createTime==""){
			alert("成立时间不能为空！");
			return false;
		}
	}
</script>


<title>北京邮电大学学生党员在线学习中心</title>
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/Admin_branchManageAction_manageBranch">党组织管理</a>&nbsp;&nbsp;>&nbsp;&nbsp;<a href="${ctx}/Admin_MyBranchAction_branchList">党组织维护</a>&nbsp;&nbsp;>&nbsp;&nbsp;修改组织摘要</div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>
<div style="clear:both; height:5px;">&nbsp;</div>

<div style="min-height:450px;">
	<div id="side_menu" style="min-height:640px;">
	    <div id="side_menu_title">
	        <img src="../../../styles/side_menu_title_img.png" alt="" />
	        <span>党组织管理</span>
	    </div>
	    <div id="side_menu_title_bottom">&nbsp;</div>
	    <div class="side_sub_menu_focus">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_branchList">党组织维护</a>
	    </div>
	     <s:if test="#session.level == 2 || #session.level == 3">
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_addBranch">新增党组织</a>
	    </div>
	    </s:if>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchNotice">支部公告管理</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchActivity">支部活动管理</a>
	    </div>
	</div>
	
	<div id="main_content">
	    <div id="main_content_title">
	        <img src="../../../styles/content_title_img.png" alt="" />
	        <span>党组织维护</span>
	    </div>
	    <div class="main_content_title_bottom">&nbsp;</div>

		<s:form action="Admin_MyBranchAction_updateRealBranch" method ="post" theme="simple" enctype="multipart/form-data"  onsubmit="return check();">
				<table class="page_table">
					<tr >
						<td class="leftTD">组织名称:</td>
						
						<td ><s:if test=" #request.level != branch.level">
						<input type="text" id ="branchNameId" value="<s:property value="branch.branchName"/>" name="branchName" maxlength="60"/><font color=red>*</font>
						</s:if>
						<s:else>
						<input type="hidden" name="branchName" value=<s:property value="branch.branchName"/> />
						<s:property value="branch.branchName"/>
						</s:else>
						</td>
						<td class="leftTD"></td>
						<td></td>
		
					</tr>
					<tr>
						<s:if test="branch.level==1">
							<td >党委书记:</td>
						</s:if><s:elseif test="branch.level==2">
							<td>分党委书记:</td>
						</s:elseif><s:else>
							<td>支部书记:</td>
						</s:else>
						
						<td ><input type="text" id ="branchSecretaryNameId" value="<s:property value='branch.branchSecretaryName'/>" name="branchSecretaryName" maxlength="60"><font color=red>*</font></td>
		
						<td>成立时间:</td>
						<td ><input id= "createTimeId" type="text" value="<s:date name="branch.createTime" format="yyyy-MM-dd"/>" name= "createTime" readonly="readonly"/><font color=red>*</font></td>
		
					</tr>
		
					<tr >
						<s:if test="branch.level==1">
							<td class="leftTD">党委副书记:</td>
						</s:if><s:elseif test="branch.level==2">
							<td class="leftTD">分党委副书记:</td>
						</s:elseif><s:else>
							<td class="leftTD">支部副书记:</td>
						</s:else>
						
						<td ><input type="text" id ="branchViceSecretaryNameId" value="<s:property value="branch.branchViceSecretaryName"/>" name="branchViceSecretaryName" maxlength="60"/></td>
						<td class="leftTD">组织委员:</td>
						<td ><input type="text" value="<s:property value="branch.organizationName"/>" name="organizationName" maxlength="60"/></td>
						
		
		
					</tr>
					<tr >
						<td >宣传委员:</td>
						<td ><input type="text" value="<s:property value="branch.publicityName"/>" name="publicityName" maxlength="60"/></td>
						<td>纪检委员:</td>
						<td ><input type="text" value="<s:property value="branch.disciplineName"/>" name="disciplineName" maxlength="60"/></td>
						
		
					</tr>
					<tr >
						<td class="leftTD">青年委员:</td>
						<td ><input type="text" value="<s:property value="branch.youthName"/>" name="youthName" maxlength="60"/></td>
						<td class="leftTD">保密委员:</td>
						<td ><input type="text" value="<s:property value="branch.confidentialityName"/>" name="confidentialityName" maxlength="60"/></td>
						
		
		
					</tr>
		
					<tr>
						<td >群众委员:</td>
						<td ><input type="text" value="<s:property value="branch.massesName"/>" name="massesName" maxlength="60"/></td>
						<td >统战委员:</td>
						<td ><input type="text" value="<s:property value="branch.unitedName"/>" name="unitedName" maxlength="60"/></td>
					</tr>
					<tr >
						<s:if test="branch.level==1">
							<td class="leftTD">党委荣誉:</td>
						</s:if><s:elseif test="branch.level==2">
							<td class="leftTD">分党委荣誉:</td>
						</s:elseif><s:else>
							<td class="leftTD">支部荣誉:</td>
						</s:else>
						
						<td colspan="3"><textarea rows="4" cols="60" name="branchHonor"><s:property value="branch.branchHonor"/></textarea></td>
					</tr>
					<tr >
						<s:if test="branch.level==1">
							<td>党委简介:</td>
						</s:if><s:elseif test="branch.level==2">
							<td>分党委简介:</td>
						</s:elseif><s:else>
							<td>支部简介:</td>
						</s:else>
						
						<td colspan="3"><textarea rows="6" cols="60" name="branchSummary"><s:property value="branch.branchSummary"/></textarea></td>
					</tr>
					
		
				
					<s:if test="branch.branchPic != null && branch.branchPic != ''">
					<tr>
							<td style="width:14%;" class="leftTD">
						 	 当前图片
							</td>
							<td colspan='3'>
								<img width="400" height="150" src="${ctx}/<s:property value="branch.branchPic"/>"/>
							</td>
					</tr>		
					</s:if>
					<tr>
					<td >上传照片:</td>
					<td colspan='3'><s:file name="branchPic"/></td>
					
					</tr>
					
		
		        
				</table>
				<input type="hidden" name="id" value=<s:property value="branch.id"/> />
				<br />
				<div align="center">
					<input type="submit" name="button" id="button" class="input-button" value="保存"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input id="history" name="history" type="button" class="input-button" value="返回" onclick="window.location.href='javascript:history.go(-1);'"/>
					
		
				</div>
		</s:form>
		</div>
		<div style="clear:both">&nbsp;</div>
</div>





